package com.xxl.job.executor.feign;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FeignConfiguration implements RequestInterceptor {

    @Value("${xxl.job.accessToken:}")
    private String accessToken;

    @Override
    public void apply(RequestTemplate template) {
        template.header("token",accessToken);//读配置
    }
}
